class ShopMailer < ActionMailer::Base

  default :from => "railsshop@gmail.com"

  def order_confirmation(user, cart, pdf_path)
    @user = user
    @cart = cart
    attachments["Bestellung.pdf"] = File.read(pdf_path)
    mail(:to => "#{user.firstname} #{user.lastname} <#{user.email}>",
         :subject => "#{t("order.model_name")} Railsshop #{l(Time.now.to_date)}")
  end

  def contact_mail(name, email, text)
    @name = name
    @text = text
    @email = email
    mail(:to => "railsshop@gmail.com", :subject => t("contact.mail.subject"))
  end

end
